package cn.magicman.controller;

import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "liteflow")
public class liteFlowController {


    @Resource
    private FlowExecutor flowExecutor;

    @GetMapping(value = "test")
    public String test() {
        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg", null);
        System.out.println(response.toString());
        return response.toString();
    }
}
